import { HOME_URL, LOGIN_URL } from "@/config";

/**
 * staticRouter (静态路由)
 */
export const staticRouter = [
  {
    path: "/",
    redirect: HOME_URL
  },
  {
    path: LOGIN_URL,
    name: "login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      title: "登录"
    }
  },
  {
    path: "/layout",
    name: "layout",
    // component: () => import("@/layouts/Layout.vue"),
    component: () => import("@/layouts/LayoutAsync.vue"),
    redirect: HOME_URL,
    children: []
  }
];
/**
 * errorRouter (错误页面路由)
 */
export const errorRouter = [
  {
    path: "/403",
    name: "403",
    component: () => import("@/components/ErrorMessage/403.vue"),
    meta: {
      title: "403页面"
    }
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/components/ErrorMessage/404.vue"),
    meta: {
      title: "404页面"
    }
  },
  {
    path: "/500",
    name: "500",
    component: () => import("@/components/ErrorMessage/500.vue"),
    meta: {
      title: "500页面"
    }
  },
  // Resolve refresh page, route warnings
  {
    path: "/:pathMatch(.*)*",
    component: () => import("@/components/ErrorMessage/404.vue")
  }
];
export const dynamicRouter = [
  {
    path: "/a",
    name: "",
    component: () => import("@/layouts/LayoutAsync.vue"),
    children: [
      {
        path: "/sys/dict/data/:dictType",
        name: "SysDictData",
        component: () => import("@/views/system/dict-data/index.vue"),
        meta: { title: "字典数据", hidden: true }
      },
      {
        path: "/micro/render/task",
        name: "MicroRenderTask",
        component: () => import("@/views/micro/render-task/index.vue"),
        meta: { title: "在线流程", hidden: true }
      },
      {
        path: "/micro/render/process",
        name: "MicroRenderProcess",
        component: () => import("@/views/micro/render-process/index.vue"),
        meta: { title: "在线流程", hidden: true }
      },
      {
        path: "/micro/render/instance",
        name: "MicroRenderInstance",
        component: () => import("@/views/micro/render-instance/index.vue"),
        meta: { title: "在线流程", hidden: true }
      }
    ]
  },
  {
    path: "/b",
    name: "",
    children: [
      {
        path: "/micro/page/:appId",
        name: "MicroPage",
        component: () => import("@/views/micro/page/index.vue"),
        meta: { title: "在线页面", hidden: true }
      }
    ]
  }
];
